package com.brush.system.domain.req.sysnotice;

import cn.hutool.core.util.StrUtil;
import com.brush.common.core.domain.page.PageAbstructReq;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.Date;

/**
 * ClassName: SysNoticeQueryReq
 * Package: com.brush.system.domain.req.sysnotice
 * Description:
 *
 * @Author luo
 * @Create 2024/8/23 20:25
 * @Version 1.0
 */

@Getter
@Setter
@ToString(callSuper = true)
@ApiModel(value = "SysNoticeQueryReq", description = "公告查询请求对象")
public class SysNoticeQueryReq extends PageAbstructReq {

    /**
     * 参数主键
     */
    @ApiModelProperty(value = "公告主键")
    private Integer noticeId;

    /**
     * 公告标题
     */
    @ApiModelProperty(value = "公告标题")
    private String noticeTitle;

    /**
     * 公告类型
     */
    @ApiModelProperty(value = "公告类型")
    private String noticeType;

    /**
     * 状态
     */
    @ApiModelProperty(value = "状态")
    private String status;

    /**
     * 创建者
     */
    @ApiModelProperty(value = "创建者")
    private String createBy;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty(value = "开始时间")
    private Date beginTime;

    @ApiModelProperty(value = "结束时间")
    private Date endTime;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    private String remark;

    @Override
    public String getOrderBy() {
        if (StrUtil.isNotBlank(super.getOrderByColumn())) {
            return super.getOrderByColumn() + " " + super.getIsAsc();
        }
        return null;
    }
}
